package pizza.admin.helper;

import java.text.DecimalFormat;

/**
 * @author Joro <george.dailiev@gmail.com>
 * @version 1.0
 */
public class FormatterHelper {
	
	/**
	 * @param number
	 * @return formated decimal
	 */
	public Double roundTwoDecimals(double number) {
		try {
			DecimalFormat twoDForm = new DecimalFormat("#.##");
			return Double.parseDouble(twoDForm.format(number));
		} catch (Exception e) {
			e.printStackTrace();
		}
//		Double.parseDouble(String.format("%.2f", number))
		return number;
	}
}
